import baseRequest from "@/common/js/request.js"

/**
 * 获取岗位分页列表
 */
function getJobPageList(params) {
	const areaId = params.areaId || uni.getStorageSync("areaId")
	if (areaId) params['userAreaId'] = areaId
	return baseRequest('/jcApi/job/pageList', params)
}

/**
 * 获取岗位投递分页列表
 */
function getJobDeliveryPageList(params) {
	return baseRequest('/jcApi/job/deliveryPageList', params)
}

/**
 * 删除岗位投递记录
 * @param jobUserIds
 */
function deleteJobDelivery(jobUserIds) {
	return baseRequest('/jcApi/job/deleteDelivery', {jobUserIds}, 'POST')
}

/**
 * 获取岗位详情
 */
function getJobDetail(jobId) {
	return baseRequest('/jcApi/job/detail', {jobId})
}

/**
 * 投递岗位简历
 */
function saveDeliveryJob(params) {
	return baseRequest('/jcApi/job/delivery', params, 'POST')
}

/**
 * 获取我的简历分页列表
 */
function getMyResumePageList(params) {
	return baseRequest('/jcApi/resume/minePageList', params)
}

/**
 * 获取简历详情
 * @param resumeId
 */
function getResumeDetail(resumeId) {
	return baseRequest('/jcApi/resume/detail', {resumeId})
}

/**
 * 保存简历
 * @param params
 */
function saveResume(params) {
	return baseRequest('/jcApi/resume/save', params, 'POST')
}

/**
 * 删除简历
 * @param resumeIds
 */
function deleteResume(resumeIds) {
	return baseRequest('/jcApi/resume/delete', {resumeIds}, 'POST')
}

/**
 * 保存联系日志
 */
function saveContactLog(params) {
	return baseRequest('/jcApi/job/saveContactLog', params, 'POST')
}

export{
	getJobPageList,
	getJobDeliveryPageList,
	deleteJobDelivery,
	getJobDetail,
	saveDeliveryJob,
	getMyResumePageList,
	getResumeDetail,
	saveResume,
	deleteResume,
	saveContactLog
}